package com.rabbiter.market.controller.user.category;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.market.common.web.response.JsonResult;
import com.rabbiter.market.domain.goods.goods_category.GoodsCategory;
import com.rabbiter.market.qo.goods_management.goods_category.QueryGoodsCategory;
import com.rabbiter.market.service.goods_management.goods_category.IGoodsCategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("userGoodsCategoryController")
@RequestMapping("/user/category")
public class GoodsCategoryController {

    @Resource
    private IGoodsCategoryService goodsCategoryService;

    @GetMapping("/get-all-category")
    public JsonResult queryPageByQo(QueryGoodsCategory qo) {
        Page<GoodsCategory> page = goodsCategoryService.queryPageByQo(qo);
        return JsonResult.success(page);
    }

}
